#include "AnimMorph.h"

AnimMorph::AnimMorph(std::string nom, std::string statut_initial, std::string morphe_initial):Anim_Holder(nom,statut_initial)
{
    morphe=morphe_initial;
}

AnimMorph::~AnimMorph()
{
    //dtor
}

int AnimMorph::GetCurMorphe(){
    int n=v_Anim_Pack.size();

    int i;
    for (i=0;i<n;i++){
        if((v_Anim_Pack[i].GetName())==morphe){
            cur_morphe=i;
            return i;
            }
        }
    std::cout<<std::endl<<"Erreur, morphe: "<<morphe<<" n'existe pas";
    return -1;
}

sf::Sprite AnimMorph::GetSprite(){
    for (unsigned int i=0;i<v_Anim_Pack.size();i++){
        v_Anim_Pack[i].Send_Statut(Statut);
        }
    this->GetCurMorphe();

    return v_Anim_Pack[cur_morphe].GetSprite();
}
